const _ = require('lodash');
const async = require('async');

const userList = [
  { departmentId: 1, employeeId: 'C217353', chineseName: '何英', englishName: 'Ying He', email: 'HE_YING@NETWORK.LILLY.COM', password: '123456', others: { formIds: [1, 2, 3] } },
];
const roleList = [
  { name: 'requester', comment: '适用于所有用户，申请表单角色', isDefault: true },
  { name: 'approver', comment: '适用于所有用户，审批表单角色', isApprover: true, isDefault: true },
  { name: 'admin', comment: '后台管理员' },
  { name: 'procurement', comment: '采购审阅人', isApprover: true },
  { name: 'legal', comment: '法务审阅人', isApprover: true },
  { name: 'ec', comment: 'E&C审阅人', isApprover: true },
  { name: 'ats', comment: 'ATS审阅人', isApprover: true, others: { managerIds: ['C217353'] } },
  { name: 'stamp', comment: '公司印章持有人', isApprover: true },
  { name: 'reporter', comment: '数据导出人', isApprover: false },
  { name: 'er', comment: '员工关系经理', isApprover: true },
  { name: 'business', comment: '业务审批人', isApprover: true },
  { name: 'ops', comment: 'ops', isApprover: true },
  { name: 'ta-1', comment: 'ta-1', type: 'ta', isApprover: true },
  { name: 'ta-2', comment: 'ta-2', type: 'ta', isApprover: true },
  { name: 'ta-3', comment: 'ta-3', type: 'ta', isApprover: true },
];
const userRoleMappingList = [
  { userEmployeeId: 'C217353', roleId: 1 },
  { userEmployeeId: 'C217353', roleId: 3 },
  { userEmployeeId: 'C217353', roleId: 4 },
  { userEmployeeId: 'C217353', roleId: 5 },
  { userEmployeeId: 'C217353', roleId: 6 },
  { userEmployeeId: 'C217353', roleId: 7 },
  { userEmployeeId: 'C217353', roleId: 8 },
  { userEmployeeId: 'C217353', roleId: 9 },
  { userEmployeeId: 'C217353', roleId: 10 },
  { userEmployeeId: 'C217353', roleId: 11 },
  { userEmployeeId: 'C217353', roleId: 12 },
  { userEmployeeId: 'C217353', roleId: 13 },
  { userEmployeeId: 'C217353', roleId: 14 },
  { userEmployeeId: 'C217353', roleId: 15 },
];
const departmentList = [
  { name: 'market', type: '1' },
  { name: 'it', type: '1' },
  { name: 'business', type: '1' },
  { name: 'sales', type: '1' },
  { name: 'commercial', type: '1' },
];
const dictionaryList = [
  { name: '业务实体1', type: 'legalEntity', others: { formIds: ['1'] } },
  { name: '业务实体2', type: 'legalEntity', others: { formIds: ['1'] } },
  { name: '业务实体3', type: 'legalEntity', others: { formIds: ['1'] } },
  { name: '业务实体4', type: 'legalEntity', others: { formIds: ['1'] } },
  { name: '业务实体5', type: 'legalEntity', others: { formIds: ['1'] } },
  { name: '成本中心1', type: 'costCenter', others: { formIds: ['1'] } },
  { name: '成本中心2', type: 'costCenter', others: { formIds: ['1'] } },
  { name: '成本中心3', type: 'costCenter', others: { formIds: ['1'] } },
  { name: '成本中心4', type: 'costCenter', others: { formIds: ['1'] } },
  { name: '成本中心5', type: 'costCenter', others: { formIds: ['1'] } },
  { name: '员工类型1', type: 'employeeType', others: { formIds: ['2'] } },
  { name: '员工类型2', type: 'employeeType', others: { formIds: ['2'] } },
  { name: '员工类型3', type: 'employeeType', others: { formIds: ['2'] } },
  { name: '员工类型4', type: 'employeeType', others: { formIds: ['2'] } },
  { name: '员工类型5', type: 'employeeType', others: { formIds: ['2'] } },
];
const formList = [
  {
    flowId: 1,
    formChineseName: '合同申请',
    formEnglishName: 'eContract',
    formNumber: 'ECF-{{moment}}YYYYMMDDHHmmssSS{{/moment}}',
    formType: 1,
    formContent: 'html',
    formStatus: 1,
    formVersion: 1,
    formIcon: 'select-elanco.png',
    verify: {
      properties: {
        legalEntity: {
          type: 'string',
        },
        department: {
          type: 'number',
          minimum: 1,
        },
        isMeeting: {
          type: 'boolean',
        },
        activityNameDescription: {
          type: 'string',
          minLength: 1,
          maxLength: 50,
        },
        totalContractAmount: {
          type: 'number',
          minimum: 0,
        },
        projectNumber: {
          type: 'string',
          maxLength: 50,
        },
        activityDateStart: {
          type: 'string',
          format: 'date',
          minLength: 1,
          maxLength: 50,
        },
        activityDateEnd: {
          type: 'string',
          format: 'date',
          minLength: 1,
          maxLength: 50,
        },
        costCenterAndAmountList: {
          type: 'array',
          minItems: 1,
          maxItems: 9,
          items: {
            type: 'object',
            properties: {
              costCenter: {
                type: 'number',
                minimum: 1,
              },
              amount: {
                type: 'number',
                minimum: 0,
              },
            },
          },
        },
        createPo: {
          type: 'boolean',
        },
        vendorName: {
          type: 'string',
          minLength: 1,
          maxLength: 50,
        },
        isVendor: {
          type: 'boolean',
        },
        acdd: {
          type: 'boolean',
        },
        briefDescription: {
          type: 'string',
          maxLength: 200,
        },
        projectContractAttachmentList: {
          type: 'array',
          minItems: 1,
          items: {
            type: 'object',
            properties: {
              container: {
                type: 'string',
                maxLength: 100,
              },
              field: {
                type: 'string',
                maxLength: 100,
              },
              name: {
                type: 'string',
                maxLength: 500,
              },
              originalFilename: {
                type: 'string',
                maxLength: 100,
              },
              size: {
                type: 'number',
                minimum: 1,
              },
              type: {
                type: 'string',
                maxLength: 500,
              },
            },
          },
        },
        vendorRequestFormAttachmentList: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              container: {
                type: 'string',
                maxLength: 100,
              },
              field: {
                type: 'string',
                maxLength: 100,
              },
              name: {
                type: 'string',
                maxLength: 500,
              },
              originalFilename: {
                type: 'string',
                maxLength: 100,
              },
              size: {
                type: 'number',
                minimum: 1,
              },
              type: {
                type: 'string',
                maxLength: 500,
              },
            },
          },
        },
        approvalStep1Approver: {
          type: 'string',
          maxLength: 50,
        },
        approvalStep2Approver: {
          type: 'string',
          maxLength: 50,
        },
        approvalStep3Approver: {
          type: 'string',
          maxLength: 50,
        },
        approvalStep4Approver: {
          type: 'string',
          maxLength: 50,
        },
      },
      required: ['legalEntity', 'department', 'isMeeting', 'activityNameDescription', 'totalContractAmount', 'projectNumber', 'activityDateStart', 'activityDateEnd', 'costCenterAndAmountList', 'createPo', 'vendorName', 'isVendor', 'briefDescription', 'projectContractAttachmentList', 'approvalStep1Approver', 'approvalStep2Approver', 'approvalStep3Approver', 'approvalStep4Approver'],
    },
  },
  {
    flowId: 2,
    formChineseName: '人力需求申请',
    formEnglishName: 'MRF',
    formNumber: 'MRF-{{moment}}YYYYMMDDHHmmssSS{{/moment}}',
    formType: 1,
    formContent: 'html',
    formStatus: 1,
    formVersion: 1,
    formIcon: 'select-hr.png',
    others: {
      businessNode: [
        {
          value: 'Bio-Medicines Business Unit',
          defaultErEmployeeId: '',
          childrenList: [
            {
              value: 'Bio-Medicines Bus Unit Medical Affairs',
              defaultErEmployeeId: 'C082750',
              childrenList: [
                {
                  value: 'China',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'CRP', defaultErEmployeeId: '' },
                    { value: 'Medical Education-CNS', defaultErEmployeeId: '' },
                    { value: 'Medical Education-Foresto', defaultErEmployeeId: '' },
                    { value: 'Medical Liaison', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'BioMedicines China',
              defaultErEmployeeId: 'C224215',
              childrenList: [
                {
                  value: 'BMBU Cialis & Retail',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Cialis & Retail office', defaultErEmployeeId: '' },
                    { value: 'Cialis Brand', defaultErEmployeeId: '' },
                    { value: 'Cialis Hosp', defaultErEmployeeId: 'C091042' },
                    { value: 'Retail', defaultErEmployeeId: '' },
                    { value: 'Retail Trade MKT', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'BMBU CNS',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'CNS Central E', defaultErEmployeeId: 'C182933' },
                    { value: 'CNS East', defaultErEmployeeId: 'C182933' },
                    { value: 'CNS North', defaultErEmployeeId: 'WF82016' },
                    { value: 'CNS Office', defaultErEmployeeId: '' },
                    { value: 'CNS South', defaultErEmployeeId: 'C091042' },
                    { value: 'CNS Strattera', defaultErEmployeeId: '' },
                    { value: 'CNS West', defaultErEmployeeId: 'C224215' },
                  ],
                },
                {
                  value: 'BMBU MKT',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'CNS & Cialis Brand', defaultErEmployeeId: '' },
                    { value: 'CNS & Cialis MKT office', defaultErEmployeeId: '' },
                    {
                      value: 'CNS & Cialis RegMKT', defaultErEmployeeId: '',
                    },
                  ],
                },
                {
                  value: 'BMBU OP',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'OP Brand', defaultErEmployeeId: '' },
                    { value: 'OP Office', defaultErEmployeeId: '' },
                    { value: 'OP RegMKT', defaultErEmployeeId: 'C182933' },
                    { value: 'OP Sales', defaultErEmployeeId: 'C224215' },
                  ],
                },
              ],
            },
          ],
        },
        {
          value: 'Diabetes Business Unit',
          defaultErEmployeeId: '',
          childrenList: [
            {
              value: 'Bio-Medicines BusUnit Medical Affairs',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'China',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'CRP', defaultErEmployeeId: '' },
                    { value: 'MAP', defaultErEmployeeId: '' },
                    { value: 'Medical Education-DIA Core', defaultErEmployeeId: '' },
                    { value: 'Medical Education-DIA Leap', defaultErEmployeeId: '' },
                    { value: 'Medical Liaison', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'China General Opex Func',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Central MKT',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'AA/Admin', defaultErEmployeeId: '' },
                    { value: 'BICO', defaultErEmployeeId: '' },
                    { value: 'LCCP & CSP', defaultErEmployeeId: '' },
                    { value: 'MCE & Analytics', defaultErEmployeeId: '' },
                    { value: 'MKT capability', defaultErEmployeeId: '' },
                    { value: 'Mkt Research & NPP', defaultErEmployeeId: '' },
                    { value: 'MT', defaultErEmployeeId: '' },
                    { value: 'PAP', defaultErEmployeeId: '' },
                    { value: 'PAP Onco', defaultErEmployeeId: '' },
                    { value: 'Sales L&D', defaultErEmployeeId: '' },
                    { value: 'SFE', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'China CA',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'ASP', defaultErEmployeeId: '' },
                    { value: 'Central Market Access', defaultErEmployeeId: '' },
                    { value: 'KA', defaultErEmployeeId: '' },
                    { value: 'National Access', defaultErEmployeeId: '' },
                    { value: 'PR', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'Finance',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Customer Service', defaultErEmployeeId: '' },
                    { value: 'Distribution', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'Medical',
                  defaultErEmployeeId: 'C082750',
                  childrenList: [
                    { value: 'Medical Education-General', defaultErEmployeeId: '' },
                    { value: 'Medical Information', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'President Office',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Quality Team',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Site Service',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Diabetes China',
              defaultErEmployeeId: 'C224215',
              childrenList: [
                {
                  value: 'DBU Alliance Brand',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Jardiance Brand', defaultErEmployeeId: '' },
                    { value: 'Trajenta Brand', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'DBU Insulin MKT',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Insulin Brand', defaultErEmployeeId: '' },
                    { value: 'Insulin RegMKT', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'DBU Insulin Sales',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Insulin Central E', defaultErEmployeeId: '' },
                    { value: 'Insulin Central N', defaultErEmployeeId: '' },
                    { value: 'Insulin Central S', defaultErEmployeeId: '' },
                    { value: 'Insulin North', defaultErEmployeeId: '' },
                    { value: 'Insulin North E', defaultErEmployeeId: '' },
                    { value: 'Insulin South', defaultErEmployeeId: '' },
                    { value: 'Insulin South E R1', defaultErEmployeeId: '' },
                    { value: 'Insulin South E R2', defaultErEmployeeId: '' },
                    { value: 'Insulin West', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'DBU KA',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'DBU Leap',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Lead HCP Education', defaultErEmployeeId: '' },
                    { value: 'Leap Sales', defaultErEmployeeId: 'WF82016' },
                  ],
                },
                {
                  value: 'DBU MKT Strategy & Operations',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'DBU OAD',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'OAD North', defaultErEmployeeId: '' },
                    { value: 'OAD RegMKT', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
          ],
        },
        {
          value: 'Elanco',
          defaultErEmployeeId: '',
          childrenList: [
            {
              value: 'APAC Commercial',
              defaultErEmployeeId: 'C215478',
              childrenList: [],
            },
            {
              value: 'Elanco Manufacturing',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Animal Health Mfg',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Wusi', defaultErEmployeeId: 'C184329' },
                  ],
                },
                {
                  value: 'Elanco External Manufacturing',
                  defaultErEmployeeId: 'C215478',
                  childrenList: [],
                },
                {
                  value: 'Mfg Procurement',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Ethics & Compliance',
              defaultErEmployeeId: '',
              childrenList: [],
            },
            {
              value: 'Finance Strategy & Operations',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Finance',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'IT',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Human Resources',
              defaultErEmployeeId: '',
              childrenList: [],
            },
            {
              value: 'Legal',
              defaultErEmployeeId: '',
              childrenList: [],
            },
            {
              value: 'Marketing',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Global Marketing',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Quality',
              defaultErEmployeeId: 'C215478',
              childrenList: [],
            },
            {
              value: 'R&D and Regulatory',
              defaultErEmployeeId: 'C215478',
              childrenList: [
                {
                  value: 'Global Development Operations',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Global Nutritional Health',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Regulatory',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
          ],
        },
        {
          value: 'Global Services',
          defaultErEmployeeId: '',
          childrenList: [
            {
              value: 'Corporate Affairs',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'China CA',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Central Market Access', defaultErEmployeeId: '' },
                    { value: 'GA', defaultErEmployeeId: '' },
                    { value: 'PR', defaultErEmployeeId: '' },
                    { value: 'Public Affairs&External Engagement', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'Ethics & Compliance',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'China E&C',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Finance and Procurement',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Business Area Finance',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Accounting', defaultErEmployeeId: '' },
                    { value: 'Diabetes', defaultErEmployeeId: '' },
                    { value: 'FP/A/IC', defaultErEmployeeId: '' },
                    { value: 'Manufacturing and Quality', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'Procurement',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'LRL', defaultErEmployeeId: '' },
                    { value: 'OUS', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'HR',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Lilly Diabetes HR',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'China', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'Manufacturing and Quality HR',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'China', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'Total Rewards-COE',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Global Compensation', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'IT',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Global Information Services',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'IT Business Operations',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Lilly International',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'China IT', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'LRL Research',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Legal',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'China Legal',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
          ],
        },
        {
          value: 'LRL',
          defaultErEmployeeId: 'C082750',
          childrenList: [
            {
              value: 'Medicines Development Unit',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'China',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Alliance Management', defaultErEmployeeId: '' },
                    { value: 'Clinical Development', defaultErEmployeeId: '' },
                    { value: 'Clinical Operation', defaultErEmployeeId: '' },
                    { value: 'Clinical Pharm', defaultErEmployeeId: '' },
                    { value: 'Clinical Trial Management', defaultErEmployeeId: '' },
                    { value: 'COO', defaultErEmployeeId: '' },
                    { value: 'CRP', defaultErEmployeeId: '' },
                    { value: 'Data Management', defaultErEmployeeId: '' },
                    { value: 'Health Outcome', defaultErEmployeeId: '' },
                    { value: 'Medical Science', defaultErEmployeeId: '' },
                    { value: 'Patient Safety', defaultErEmployeeId: '' },
                    { value: 'Project Management', defaultErEmployeeId: '' },
                    { value: 'Quality', defaultErEmployeeId: '' },
                    { value: 'Regulatory Affairs', defaultErEmployeeId: '' },
                    { value: 'Scientific Communication', defaultErEmployeeId: '' },
                    { value: 'Six Sigma', defaultErEmployeeId: '' },
                    { value: 'Stats', defaultErEmployeeId: '' },
                    { value: 'VP Office', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'GPO RWE',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'International HO and HTA', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'Research',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Endocrine',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Endo and CV Research', defaultErEmployeeId: '' },
                    { value: 'LCRDC Operations', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'Oncology',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
          ],
        },
        {
          value: 'Manufacturing and Quality',
          defaultErEmployeeId: '',
          childrenList: [
            {
              value: 'Emerging Markets',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'China',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Global Logistics/Other',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'Novast/Other External Mfg',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
            {
              value: 'Quality',
              defaultErEmployeeId: '',
              childrenList: [
                {
                  value: 'Admin',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
              ],
            },
          ],
        },
        {
          value: 'Oncology Business Unit',
          defaultErEmployeeId: 'C082750',
          childrenList: [
            {
              value: 'Oncology Bus Unit Medical Affairs',
              defaultErEmployeeId: 'C082750',
              childrenList: [
                {
                  value: 'China',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'CRP', defaultErEmployeeId: '' },
                    { value: 'Health Outcome', defaultErEmployeeId: '' },
                    { value: 'Medical Liaison', defaultErEmployeeId: '' },
                    { value: 'Patient Safety', defaultErEmployeeId: '' },
                  ],
                },
              ],
            },
            {
              value: 'Onconlogy China',
              defaultErEmployeeId: 'C224215',
              childrenList: [
                {
                  value: 'OBU Global Brand',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'OBU GL Brand', defaultErEmployeeId: '' },
                    { value: 'OBU GL Launch', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'OBU MKT',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Onco Brand', defaultErEmployeeId: '' },
                    { value: 'Onco RegMKT', defaultErEmployeeId: '' },
                  ],
                },
                {
                  value: 'OBU Office',
                  defaultErEmployeeId: '',
                  childrenList: [],
                },
                {
                  value: 'OBU Sales',
                  defaultErEmployeeId: '',
                  childrenList: [
                    { value: 'Fruquintinib Sales', defaultErEmployeeId: '' },
                    { value: 'Onco East', defaultErEmployeeId: 'C182933' },
                    { value: 'Onco North', defaultErEmployeeId: 'WF82016' },
                    { value: 'Onco South', defaultErEmployeeId: 'C091042' },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
    verify: {
      properties: {
        hiringManagerEmployeeId: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        positionTitle: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode1Code: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode1: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode2Code: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode2: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode3Code: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode3: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode4Code: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        businessNode4: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        employeeType: {
          type: 'number',
          minimum: 0,
        },
        costCenter: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        workingLocationProvinceCode: {
          type: 'number',
        },
        workingLocationProvince: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        workingLocationCityCode: {
          type: 'number',
        },
        workingLocationCity: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        jobNumber: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        positionId: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        forwardToOtherEr: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
      },
      required: ['hiringManagerEmployeeId', 'positionTitle', 'businessNode1Code', 'businessNode1', 'businessNode2Code', 'businessNode2', 'businessNode3Code', 'businessNode3', 'businessNode4Code', 'businessNode4', 'employeeType', 'costCenter', 'workingLocationProvinceCode', 'workingLocationProvince', 'workingLocationCityCode', 'workingLocationCity', 'jobNumber', 'positionId', 'forwardToOtherEr'],
    },
  },
  {
    flowId: 3,
    formChineseName: '采购需求申请',
    formEnglishName: 'e-PR',
    formNumber: 'EPR-{{moment}}YYYY0000{{/moment}}',
    formType: 1,
    formContent: 'html',
    formStatus: 1,
    formVersion: 1,
    formIcon: 'select-pr.png',
    verify: {
      properties: {
        legalEntity: {
          type: 'array',
          minItems: 1,
          maxItems: 20,
          items: {
            type: 'string',
            minimum: 1,
            maxLength: 50,
          },
        },
        activityName: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        budget: {
          type: 'number',
          minimum: 0,
        },
        department: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        costCenter: {
          type: 'array',
          minItems: 1,
          maxItems: 20,
          items: {
            type: 'string',
            minimum: 1,
            maxLength: 50,
          },
        },
        atsApproverEmployeeId: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        opOwnerEmployeeId: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        email: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        phone: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
        Specifications: {
          type: 'array',
          minItems: 1,
          maxItems: 20,
          items: {
            type: 'object',
            properties: {
              utbSpecDesc: {
                type: 'string',
                minimum: 1,
                maxLength: 50,
              },
              utbSpecQty: {
                type: 'number',
                minimum: 0,
              },
              utbSpecDate: {
                type: 'string',
                format: 'date',
                minLength: 1,
                maxLength: 50,
              },
              utbSpecRemark: {
                type: 'string',
                minimum: 0,
                maxLength: 50,
              },
            },
          },
        },
        utbSpecCategory: {
          type: 'string',
          minimum: 1,
          maxLength: 50,
        },
        complianceAudit: {
          type: 'string',
          minimum: 0,
        },
        qualityAudit: {
          type: 'string',
          minimum: 0,
        },
        additionalRemark: {
          type: 'string',
          minimum: 0,
        },
        additionalAttenchment: {
          type: 'array',
          minItems: 0,
          items: {
            type: 'object',
            properties: {
              container: {
                type: 'string',
                maxLength: 100,
              },
              field: {
                type: 'string',
                maxLength: 100,
              },
              name: {
                type: 'string',
                maxLength: 500,
              },
              originalFilename: {
                type: 'string',
                maxLength: 100,
              },
              size: {
                type: 'number',
                minimum: 1,
              },
              type: {
                type: 'string',
                maxLength: 500,
              },
            },
          },
        },
        prId: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
        utbContractAmount: {
          type: 'number',
        },
        utbBidding: {
          type: 'string',
          minimum: 0,
        },
        utbBiddingType: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
        utbSavingMethod: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
        utbCostAvoidance: {
          type: 'number',
        },
        utbCostSaving: {
          type: 'number',
        },
        utbLateInvolvment: {
          type: 'string',
          minimum: 0,
        },
        utbLowestPriceSelected: {
          type: 'string',
          minimum: 0,
        },
        utbProcurementType: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
        turnAroundTime: {
          type: 'string',
          format: 'date',
          minLength: 1,
          maxLength: 50,
        },
        approvalStep1Approver: {
          type: 'string',
          minimum: 0,
          maxLength: 50,
        },
      },
      required: [],
    },
  },
];
const flowList = [
  {
    flowName: 'eContractFlow',
    flowType: 1,
    flowRun: {
      isEmailSend: true,
      isDynamicFlow: false,
      configData: { buyerEmail: 'LI_XIAO_SH@LILLY.COM' },
      steps: [
        {
          approvalStep: 1,
          stepType: 1,
          name: '采购审批',
          englishName: 'Procurement Approver',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 4,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 1,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 2,
                  }],
              },
            },
            {
              status: 'cancel',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 8,
                  }],
              },
            },
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 7,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [4],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 2,
          stepType: 1,
          name: '法务审批',
          englishName: 'Legal Approver',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 4,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 1,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 2,
                  }],
              },
            },
            {
              status: 'cancel',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 8,
                  }],
              },
            },
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 7,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [5],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 3,
          stepType: 1,
          name: 'E&C审批',
          englishName: 'E&C',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 4,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 1,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 2,
                  }],
              },
            },
            {
              status: 'cancel',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 8,
                  }],
              },
            },
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 7,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [6],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 4,
          stepType: 1,
          name: 'ATS审批',
          englishName: 'ATS',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 4,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 5,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 7,
                  }],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 2,
                  }],
              },
            },
            {
              status: 'cancel',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 8,
                  }],
              },
            },
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 7,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [7],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 5,
          stepType: 1,
          name: '公司印章持有',
          englishName: 'Company Stamp Holder',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 4,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 3,
                  }],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 5,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 7,
                  }],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 2,
                  }],
              },
            },
            {
              status: 'cancel',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 8,
                  }],
              },
            },
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 6,
                  }],
              },
            },
          ],
          note: '',
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [8],
              users: [],
              sql: '',
            },
            defaultHandlerUser: 'C217353',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        }],
      buttons: [],
      conditions: [
        {
          isJudge: true,
          customMethod: 'eContractHaveProcurement',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: true,
          customMethod: 'eContractHaveLegal',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: true,
          customMethod: 'eContractHaveEC',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        }],
      events: {
        submitBefore: '',
        submitAfter: '',
        approvalBefore: '',
        approvalAfter: '',
        rejectBefore: '',
        rejectAfter: '',
      },
    },
    flowDesign: {},
    flowStatus: 1,
    flowVersion: 1,
  },
  {
    flowName: 'manpowerRequisitionFlow',
    flowType: 1,
    flowRun: {
      isEmailSend: true,
      isDynamicFlow: true,
      configData: { buyerEmail: 'LI_XIAO_SH@LILLY.COM' },
      steps: [
        {
          approvalStep: 1,
          stepType: 1,
          name: '员工关系经理审批',
          englishName: 'ER Approver',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    templateId: 10,
                  }],
              },
            },
            {
              status: 'forword',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    templateId: 10,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 20,
                  },
                ],
              },
            },
            {
              status: 'noBusinessApprove',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '12',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 12,
                  }],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 11,
                  },
                  {
                    user: {
                      userId: '',
                      roleId: '-3',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 20,
                  },
                ],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    cc: {
                      userId: '',
                      roleId: '-6',
                    },
                    templateId: 15,
                  },
                ],
              },
            },
            {
              status: 'return',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 13,
                  },
                ],
              },
            },
            {
              status: 'reSubmit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    templateId: 17,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [10],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 2,
          stepType: 1,
          name: '业务审批',
          englishName: 'Business Approver',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '12',
                    },
                    cc: {
                      userId: '',
                      roleId: '',
                    },
                    templateId: 12,
                  },
                ],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    cc: {
                      userId: '',
                      roleId: '-6',
                    },
                    templateId: 15,
                  },
                ],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [11],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 3,
          stepType: 1,
          name: 'OPS审批',
          englishName: 'OPS Approver',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '13,14,15',
                    },
                    cc: {
                      userId: '',
                      roleId: '12',
                    },
                    templateId: 14,
                  },
                ],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    cc: {
                      userId: '',
                      roleId: '-6',
                    },
                    templateId: 15,
                  },
                ],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [12],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 4,
          stepType: 1,
          name: 'TA审批',
          englishName: 'TA Approver',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    templateId: 10,
                  }],
              },
            },
            {
              status: 'rejected',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    cc: {
                      userId: '',
                      roleId: '-6',
                    },
                    templateId: 19,
                  },
                ],
              },
            },
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-1,-4',
                    },
                    cc: {
                      userId: '',
                      roleId: '13,14,15',
                    },
                    templateId: 18,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        }],
      buttons: [],
      conditions: [
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: true,
          customMethod: 'manpowerRequisitionHaveBusiness',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        }],
      events: {
        submitBefore: '',
        submitAfter: 'manpowerRequisitionCreateHiringManager',
        approvalBefore: '',
        approvalAfter: 'manpowerRequisitionCreateBusiness',
        rejectBefore: '',
        rejectAfter: '',
      },
    },
    flowDesign: {},
    flowStatus: 1,
    flowVersion: 1,
  },
  {
    flowName: 'e-PR',
    flowType: 1,
    flowRun: {
      isEmailSend: true,
      isDynamicFlow: true,
      configData: { buyerEmail: 'LI_XIAO_SH@LILLY.COM' },
      steps: [
        {
          approvalStep: 1,
          stepType: 1,
          name: '非会议',
          englishName: 'UTB',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'submit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2,20',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1',
                    },
                    templateId: 4,
                  },
                ],
              },
            },
            {
              status: 'approve',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2,20',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1',
                    },
                    templateId: 1,
                  },
                ],
              },
            },
            {
              status: 'cancel',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2,20',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1',
                    },
                    templateId: 2,
                  }],
              },
            },
            {
              status: 'resubmit',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2,20',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1',
                    },
                    templateId: 2,
                  }],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [4],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
        {
          approvalStep: 2,
          stepType: 1,
          name: '会议',
          englishName: 'xxx',
          commentDisplay: 1,
          expiredType: 1,
          signatureType: 1,
          limitTime: '',
          note: '',
          emailSend: [
            {
              status: 'complete',
              steps: {
                0: [
                  {
                    user: {
                      userId: '',
                      roleId: '-2,20',
                    },
                    cc: {
                      userId: '',
                      roleId: '-1',
                    },
                    templateId: 4,
                  },
                ],
              },
            },
          ],
          behavior: {
            flowType: 1,
            runSelect: 1,
            handlerType: 0,
            selectRange: {
              roles: [4],
              users: [],
              sql: '',
            },
            defaultHandlerUser: '',
            rejectType: 2,
            rejectStep: '',
            percentage: '',
            countersignature: 0,
            countersignaturePercentage: '',
          },
        },
      ],
      buttons: [],
      conditions: [
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
        {
          isJudge: false,
          customMethod: '',
          sql: '',
          organize_senderin: '',
          organize_sendernotin: '',
          organize_sponsorin: '',
          organize_sponsornotin: '',
          organize_senderleader: 0,
          organize_senderchargeleader: 0,
          organize_sponsorleader: 0,
          organize_sponsorchargeleader: 0,
          organize_notsenderleader: 0,
          organize_notsenderchargeleader: 0,
          organize_notsponsorleader: 0,
          organize_notsponsorchargeleader: 0,
        },
      ],
      events: {
        submitBefore: '',
        submitAfter: '',
        approvalBefore: '',
        approvalAfter: '',
        rejectBefore: '',
        rejectAfter: '',
      },
    },
    flowDesign: {},
    flowStatus: 1,
    flowVersion: 1,
  },
];

const templateList = [
  {
    name: 'approvalEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{requester.chineseName}}，<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>业务申请已通过{{nextApprover.englishName}}的审阅。您可以登陆合同审阅管理系统查看您提交的所有业务申请的审阅状态:<a href="{{host}}/eLanco/submitList">点击这里</a><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{requester.englishName}},<br><br>Your request on E-Contract needs you submit related application material.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Go to Contract Review Management System to review all your requests.:<a href="{{host}}/eLanco/submitList">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - Your E-Contract Request needs you submit related application material/业务编号{{formDetail.formNumber}}: {{nextApprover.approvalName}}审阅已通过.',
  },
  {
    name: 'rejectEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{requester.chineseName}}，<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>业务申请已被{{approver.englishName}}拒绝。您可以登陆合同审阅管理系统查看您提交的所有业务申请的审阅状态:<a href="{{host}}/eLanco/submitList">点击这里</a><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{requester.englishName}},<br><br>Your request has been rejected by {{approver.englishName}}.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Go to Contract Review Management System to review all your requests.:<a href="{{host}}/eLanco/submitList">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - Your E-Contract Request has been rejected/业务编号{{formDetail.formNumber}}: {{approver.approvalName}}审阅已拒绝',
  },
  {
    name: 'willApproverEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{nextApprover.chineseName}}，<br><br>请审阅此业务申请. 你审阅完成后系统会通知其他审阅人进行后续审阅。<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>请点击以下地址进行审批:<a href="{{host}}/eLanco/detail?model=detail&form=approval&formId={{form.id}}&id={{formDetail.id}}&backId=3&action=look">点击这里</a><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{nextApprover.englishName}},<br><br>A request on E-Contract is waiting for your approval. Other related approvers/requestor will be notified by e-mail upon your approval.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Please approve the business application by click:<a href="{{host}}/eLanco/detail?model=detail&form=approval&formId={{form.id}}&id={{formDetail.id}}&backId=3&action=look">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - An E-Contract Request is waiting for your approval/请审阅业务申请',
  },
  {
    name: 'submitSucceedEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{requester.chineseName}}，<br><br>您在E-Contract上的申请已经成功提交. 审批人会立即收到邮件通知。<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>您的业务需经过的审阅流程如下:{{getAllApprovalHtml approvalList false}}<br><br>业务获得您的部门主管审批之前, 您可以登陆合同审阅管理系统查看本次业务申请:<a href="{{host}}/eLanco/detail?model=detail&formId={{form.id}}&id={{formDetail.id}}">点击这里</a><br>也可以登陆查看您提交的其他业务申请的审阅状态:<a href="{{host}}/eLanco/submitList">点击这里</a><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{requester.englishName}},<br><br>Your E-Contract request was submitted sucessfully. Approvers will be notified by e-mail immediately.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Your request need to be approved by following processes:{{getAllApprovalHtml approvalList true}}<br><br>To review this request please click this link:<a href="{{host}}/eLanco/detail?model=detail&formId={{form.id}}&id={{formDetail.id}}">Click Here</a><br>To review your other request please click this link:<a href="{{host}}/eLanco/submitList">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - Your E-Contract Request was submitted/您的业务申请已提交',
  },
  {
    name: 'approvalFinishEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{requester.chineseName}}，<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>业务审阅人:{{getAllApprovalHtml approvalList false}}<br><br>您提交的业务申请已经通过以上全部审阅人的审阅。<br>您可以登陆合同审阅管理系统查看您提交的所有业务申请的审阅状态:<a href="{{host}}/eLanco/submitList">点击这里</a><br><br>请将最终批准的合同转换成PDF版本后交对方签字盖章. 请直接打印CHIEF系统中经批准的合同, 请勿未经授权擅自修改合同内容, 也请监督对方不得未经礼来同意修改合同内容。<br><br>您的合同在加盖公司公章/合同专用章之前, 请根据FRAP及P2P等相关政策, 在适用的情况下取得采购部(ATC)或授权签字人(DATC)的书面签字。<br><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{requester.englishName}},<br><br>Your request on E-Contract has been approved by all approvers.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Approvers:{{getAllApprovalHtml approvalList true}}<br><br>Go to Contract Review Management System to review all your requests.:<a href="{{host}}/eLanco/submitList">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - Your E-Contract Request has been approved by all approvers/业务编号{{formDetail.formNumber}}: 业务申请已通过全部审阅,请等待公司印章人同意',
  },
  {
    name: 'approvalFinishEndEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{requester.chineseName}}，<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>业务审阅人:{{getAllApprovalHtml approvalList false}}<br><br>您提交的业务申请已经通过以上全部审阅人的审阅。<br>您可以登陆合同审阅管理系统查看您提交的所有业务申请的审阅状态:<a href="{{host}}/eLanco/submitList">点击这里</a><br><br>请将最终批准的合同转换成PDF版本后交对方签字盖章. 请直接打印CHIEF系统中经批准的合同, 请勿未经授权擅自修改合同内容, 也请监督对方不得未经礼来同意修改合同内容。<br><br>您的合同在加盖公司公章/合同专用章之前, 请根据FRAP及P2P等相关政策, 在适用的情况下取得采购部(ATC)或授权签字人(DATC)的书面签字。<br><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{requester.englishName}},<br><br>Your request on E-Contract has been approved by all approvers.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Approvers:{{getAllApprovalHtml approvalList true}}<br><br>Go to Contract Review Management System to review all your requests.:<a href="{{host}}/eLanco/submitList">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - Your E-Contract Request has been approved by all approvers/业务编号{{formDetail.formNumber}}: 业务申请已通过全部审阅',
  },
  {
    name: 'finishToStampTemplate',
    formId: 1,
    emailBody: '亲爱的 {{nextApprover.chineseName}}，<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>业务审阅人:{{getApprovalHtml approvalList false}}<br><br>申请人提交的业务申请已经通过以上全部审阅人的审阅。<br>请在最终批准的合同上加盖公章，并在完成之后登陆CHIEF系统进行盖章确认<a href="{{host}}/eLanco/eContractDetail?model=detail&formId={{form.id}}&id={{formDetail.id}}&backId=3&action=look">点击这里</a><br><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{stamp.englishName}},<br><br>Your request on E-Contract has been approved by all approvers.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Approvers:{{getApprovalHtml approvalList true}}<br><br>Please stamp on the contract and then go to Contract Review Management System to confirm the stamp action has been taken<a href="{{host}}/eLanco/eContractDetail?model=detail&formId={{form.id}}&id={{formDetail.id}}&backId=3&action=look">Click Here</a><br><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline. <br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - This E-Contract Request has been approved by all approvers/业务编号{{formDetail.formNumber}}: 业务申请已通过全部审阅',
  },
  {
    name: 'cancelEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 {{approver.englishName}}，<br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li></ul><br>业务申请已被申请人撤回。<br>您可以登陆合同审阅管理系统查看您审批的所有业务申请的审阅状态:<a href="{{host}}/eLanco/approvalList">点击这里</a><br><br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear {{approver.englishName}},<br><br>Request has been recalled by requester.<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li></ul><br>Approvers:{{getAllApprovalHtml approvalList true}}<br><br>To review all your requests please click this link:<a href="{{host}}/eLanco/approvalList">Click Here</a><br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>Visit CHIEF at: <a href="{{host}}">点击这里 Click Here</a>',
    subject: 'CHIEF - E-Contract Request has been recalled/申请已经被撤回',
  },
  {
    name: 'newvendorEmailTemplate',
    formId: 1,
    emailBody: '亲爱的 采购专员: <br><br>简要信息：<ul><li>业务编号: {{formDetail.formNumber}}</li><li>业务名称: {{form.formChineseName}}</li><li>业务提交日期: {{formatDate formDetail.createdAt}}</li><li>业务提交者: {{requester.chineseName}}</li><li>新供应商名称: {{formDetail.formDetail.vendorName}}</li></ul><br>申请人已经提交新建供应商的申请。<br>申请人会线下联系您并递交申请相关的申请材料。<br>请不要直接回复这份系统产生的邮件. 如有任何疑问, 请致电IT服务台1499热线。<br><br>Dear Procurement Specialist,<br><br>Brief information:<ul><li>Business Code: {{formDetail.formNumber}}</li><li>Business Description: {{form.formEnglishName}}</li><li>Submitted on: {{formatDate formDetail.createdAt}}</li><li>Applicant: {{requester.englishName}}</li><li>New vendor name: {{formDetail.formDetail.vendorName}}</li></ul><br>The new vendor creation request has been raised.<br>The requestor will conact you and send you relevant materials of this request.<br>Please do not reply to this system generated e-mail. For any inquiries, please call IT Helpdesk 1499 hotline.<br><br>Regards,<br>CHIEF Administrator<br>(CHIEF - your online approval platform!)<br><br>',
    subject: 'CHIEF – New vendor Request has been raised/新建供应商申请',
  },
  {
    name: 'confirmationRequest',
    formId: 2,
    priority: '1 (High)',
    emailBody: '人力资源经理您好 ，&nbsp;<br />&nbsp;&nbsp;<br />您区域内主管<b>{{formDetail.formDetail.hiringManager.chineseName}}</b>团队现有职位需开招，请对职位信息进行确认；若职位符合招聘条件，请提供职位的Job No./Path Level&amp;Scale，并请点击确认；人事运营团队将根据职位信息创建职位编码，以便招聘团队尽快启动招聘。谢谢！&nbsp;<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：{{formDetail.formDetail.positionTitle}}&nbsp;<br />员工类型 : {{formDetail.formDetail.employeeTypeName}}<br />主管：{{formDetail.formDetail.hiringManager.chineseName}}&nbsp;<br />工作地点：{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}&nbsp;&nbsp;<br /><br />礼来中国人力资源团队<br /><br /><br />Dear HR Manager,&nbsp;<br /><br />The team under supervisor <b>{{formDetail.formDetail.hiringManager.englishName}}</b> now has an open position. Please help confirme the position information and provide the Job No./Path Level&amp;Scale in the form. If correct, please click CONFIRM. HR Operaton team will created position ID in systerm, so recruiting team can initiate recruitment ASAP. Thank you!<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：{{formDetail.formDetail.positionTitle}}&nbsp;<br />Employee Type: {{formDetail.formDetail.employeeTypeName}}<br />Supervisor：{{formDetail.formDetail.hiringManager.englishName}}&nbsp;<br />Working Location：{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}&nbsp;<br /><br /><br />Lilly China HR Team<br />',
    subject: 'MRF Confirmation Request/人力需求申请表确认请求 -Supervisor {{formDetail.formDetail.hiringManager.englishName}}',
  },
  {
    name: 'confirmationRequest',
    formId: 2,
    priority: '1 (High)',
    emailBody: '尊敬的<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.business.chineseName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">您好，</span><br /><br />您区域内主管<span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span> 团队现有职位需开招,请确认空缺职位是否可以启动招聘；如职位可以启动招聘，请点击确认；人事运营团队将根据职位信息创建职位编码，以便招聘团队尽快启动招聘。谢谢！&nbsp;<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />员工类型:&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span><br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br /><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{approver.chineseName}}</span><br />礼来中国人力资源团队<br /><br />Dear&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.business.englishName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">,&nbsp;</span><br /><br />The team under supervisor <span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span> now has an open position. Please help confirme whether the position can initiate recritment in the form. If yes, please click CONFIRM. HR Operaton team will created position ID in systerm, so recruiting team can initiate recruitment ASAP. Thank you!<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />Employee Type:&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">&nbsp;</span><br />Supervisor：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span>&nbsp;<br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br /><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{approver.englishName}}</span><br />Lily China HR Team',
    subject: 'MRF Confirmation Request/人力需求申请表确认请求 -Supervisor {{formDetail.formDetail.hiringManager.englishName}} ',
  },
  {
    name: 'positionConfirmation',
    formId: 2,
    priority: '1 (High)',
    emailBody: '人力资源运营团队你好！&nbsp;<br />主管<span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span>团队空缺职位的信息已确认。请根据表单信息在系统中建立职位编码， 以便招聘团队尽快启动招聘。 谢谢！<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />员工类型:&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">&nbsp;</span><br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span><br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br />礼来中国人力资源团队<br /><br /><br />Dear Operation Team,&nbsp;<br /><br />The source and job information of open position in <span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span>\'s team has confirmed. Please create position in system and inform TA Team to kick off recruiting process in their first convenience. Thank you!&nbsp;<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />Employee Type:&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><br />Supervisor：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span>&nbsp;<br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br />Lilly China HR Team<br />',
    subject: 'MRF Position Confirmation/人力需求申请表职位确认 - Supervisor {{formDetail.formDetail.hiringManager.englishName}}',
  },
  {
    name: 'return',
    formId: 2,
    priority: '1 (High)',
    emailBody: '主管您好，&nbsp;<br /><br />根据沟通，您所提交的人力需求申请表信息需要修改；请重新填写并提交。谢谢！&nbsp;<br />人事经理备注：<b>{{formDetail.formDetail.comment}}</b>&nbsp;<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：{{formDetail.formDetail.positionTitle}}<br />主管：{{formDetail.formDetail.hiringManager.chineseName}}<br />工作地点：{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}&nbsp;<br /><br />礼来中国人力资源团队<br /><br /><br />Dear supervisor,&nbsp;<br />As communicated, you need to remodify the submitted form information. Please fill and resubmit it again. Thank you!&nbsp;<br />ER/BP Comments：<b>{{formDetail.formDetail.comment}}</b>&nbsp;<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：{{formDetail.formDetail.positionTitle}}&nbsp;<br />Supervisor：{{formDetail.formDetail.hiringManager.englishName}}&nbsp;<br />Working Location：{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}&nbsp;<br /><br />Lilly China HR Team',
    subject: 'MRF Return/人力需求表退回 -Position title {{formDetail.formDetail.positionTitle}}',
  },
  {
    name: 'hiringRequest',
    formId: 2,
    priority: '1 (High)',
    emailBody: '<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">招聘团队您好，&nbsp;<br /><br />主管<span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span> 团队空缺职位已通过审批且在系统中建立。请根据人力需求表中职位信息尽快启动招聘流程。谢谢！&nbsp;<br />友情提示：启动招聘前，<span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">请务必点击表单中的启动招聘按钮</span>；<br /><br />《人力资源需求申请表》链接：  <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br /><br />礼来中国人力资源团队<br /><br />Dear Recruiting Team,&nbsp;<br /><br />The open position under <span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span> has been approved and created in the system. Please ckick off the recruiting process based on the MRF.Thank you!&nbsp;<br />Kindly reminder: <span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">Please be sure to click the initate button in the form before you kick off recruitment</span><br /><br />Link to Manpower Requisition Form: Manpower <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br /><br />Lilly China HR Team</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"><br /><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"></span><br /><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"></span><br /><br /><br /></span><br />',
    subject: 'Hiring request/招聘请求-{{formDetail.formDetail.hiringManager.englishName}} 团队{{formDetail.formDetail.positionTitle}} 职位',
  },
  {
    name: 'MRFRejection',
    formId: 2,
    priority: '1 (High)',
    emailBody: '<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">主管您好，&nbsp;<br /><br />根据沟通，您所提交的人力需求申请表没有通过审批。谢谢！<br />备注：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.comment}}</span><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br />拒绝原因：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.comment}}</span>&nbsp;<br /><br />礼来中国人力资源团队<br /><br />Dear Supervisor,&nbsp;<br /><br />As communicated, the application has not been approved. Thank you!&nbsp;<br />Remark:&nbsp;<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.comment}}</span><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />Supervisor：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span><br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br />Reject Reason：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.comment}}&nbsp;</span>&nbsp;<br /><br />Lilly China HR Team</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"><br /><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"></span><br /><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"></span><br /><br /><br /></span><br />',
    subject: 'MRF Rejection/人力需求表拒绝- Position title {{formDetail.formDetail.positionTitle}} ',
  },
  {
    name: 'confirmationReminding',
    formId: 2,
    emailBody: '<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">审批人您好，<br /><br />主管<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span>于<span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatDate formDetail.createdAt}}</span>触发了Position Title -&nbsp;<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>职位的《人力资源需求申请表》，将在收到您对该表单的确认后的两个工作日之内建立职位启动外招程序。目前我们还未收到您的确认。<br /><br />《人力资源需求申请表》链接： Manpower Requisition <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span><br />员工类型 :&nbsp;</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;"></span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"><br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;&nbsp;<br /><br />礼来中国人力资源团队&nbsp;<br /><br /><br />Dear Approver,<br /><br />Supervisor <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span> has initiated MRF on <span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatDate formDetail.createdAt}}</span> for position <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>. We will kick off recruiting process in two business day after we get your confirmation. So far, we have not get your confirmation. Please help confirm the position.<br /><br />Position Title:&nbsp;<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><br />Employee Type:&nbsp;</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;"></span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"><br />supervisor:&nbsp;<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span><br />Working Location:&nbsp;<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br />Lilly China HR Team<br /></span><br />',
    subject: 'MRF Confirmation Reminding/确认提醒 - Supervisor {{formDetail.formDetail.hiringManager.englishName}}',
  },
  {
    name: 'reSubmit',
    formId: 2,
    emailBody: '人力资源经理您好，<br /><br />主管<span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span>已重新提交空缺职位<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span> 的人力需求申请表，请确认表单中的职位信息。<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />员工类型 :&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;"></span><br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span>&nbsp;<br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;&nbsp;<br /><br />礼来中国人力资源团队&nbsp;<br /><br /><br />Dear HR Manager,<br /><br />Supervisor <span style="font-weight:700;color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span> has resubmitted MRF based on business needs.&nbsp; Please help confirm the position‘s information.<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a><br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span><br />Employee Type:&nbsp;<span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">{{formDetail.formDetail.employeeTypeName}}</span><span style="font-family:&quot;font-weight:500;color:#333333;font-size:14px;">&nbsp;</span><br />Supervisor：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span><br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br />Lilly China HR Team<br /><br />',
    subject: 'MRF Re-submit/重新提交-人力需求申请表重新提交- Supervisor {{formDetail.formDetail.hiringManager.englishName}} ',
  },
  {
    name: 'requestApproved',
    formId: 2,
    emailBody: '<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">主管<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span>您好，<br /><br />您团队空缺职位 <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">Position Title&nbsp;</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>已通过招聘审核；启动招聘前，招聘团队将会与您关于空缺职位以及招聘需求进行沟通；请确保招聘的职位描述(JD)已准备好。谢谢！<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br />礼来中国人力资源招聘团队<br /><br /><br />Dear <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span>,<br /><br />Your application for the open position - Position Title&nbsp;<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span> &nbsp;has been approved for recruitment.. Before kicking off the recruitment, we will contact you and have a job brief meeting to understand the job and recruitment requirements. Please make sure the Job Description is ready.<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span><br /><br />Lilly China HR Talent Acquisition Team</span><br />',
    subject: ' Recruiting Request Approved/招聘请求审批通过- Position Title：{{formDetail.formDetail.positionTitle}} ',
  },
  {
    name: 'cancellation',
    formId: 2,
    priority: '1 (High)',
    emailBody: '<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">您好，&nbsp;<br /><br />根据沟通，主管<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span>于<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatDate formDetail.createdAt}}</span>所提交的人力需求申请表，在招聘过程中撤销了。谢谢您对我们工作的支持！！<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br />备注：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.taCancelComment}}</span>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;"><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span></span><br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br /><br /><br />礼来中国人力资源招聘团队<br /><br />Dear,&nbsp;<br />As communicated, the MRF requested by supervisor <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span> on <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatDate formDetail.createdAt}}</span> has been cancelled in the hiring process. Thank you for your understanding!<br /><br />Link to Manpower Requisition Form:  <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br />Coments：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.taCancelComment}}&nbsp;</span>&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span><br />Supervisor：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br /><br /><br />Lilly China HR TA Team<br /></span><br />',
    subject: 'MRF Cancellation /人力需求表单撤销- Position title {{formDetail.formDetail.positionTitle}} ',
  },
  {
    name: 'cancellation',
    formId: 2,
    priority: '1 (High)',
    emailBody: '<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{approver.chineseName}}</span>您好，&nbsp;<br />您已将表单成功转发给<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{nextApprover.chineseName}}</span>；谢谢！<br /><br />《人力资源需求申请表》链接： <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />职位名称：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span><br />主管：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.chineseName}}</span><br />工作地点：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br /><br />礼来中国人力资源团队<br /><br />Dear <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{approver.englishName}}</span>,&nbsp;<br />You have fowared the Form successful to <span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{nextApprover.englishName}}</span>.Thank you!<br /><br />Link to Manpower Requisition Form: <a href="{{host}}/eLanco/manpowerRequisitionDetail?model=detail&formId={{formDetail.formId}}&id={{formDetail.id}}&backId=2&action=look" target="_blank" style="color: rgb(0, 0, 255); background-color: rgb(255, 255, 255);">Manpower Requisition Form-{{formDetail.formNumber}}</a>&nbsp;<br /><br />Position Title：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.positionTitle}}</span>&nbsp;<br />Supervisor：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formDetail.formDetail.hiringManager.englishName}}</span><span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">&nbsp;</span>&nbsp;<br />Working Location：<span style="color:#333333;font-family:&quot;font-size:14px;background-color:#FFFFFF;">{{formatProvinceAndCity formDetail.formDetail.workingLocationProvince formDetail.formDetail.workingLocationCity}}</span>&nbsp;<br /><br /><br />Lilly China HR TA Team<br />',
    subject: 'MRF Fowarded Successful/人力需求表单转发成功- Position title {{formDetail.formDetail.positionTitle}} ',
  },
];

module.exports = (app) => {
  const { SysUser: userModel, SysRole: roleModel, SysUserRoleMapping: userRoleMappingModel, SysDepartment: departmentModel, WfForm: formModel, SysDictionary: dictionaryModel, WfFlow: flowModel, WfTemplate: templateModel } = app.models;

  const initTableData = (model, data, callback) => {
    const getDataCount = (next) => {
      model.count(next);
    };
    const createData = (count, next) => {
      if (count != 0) return next(null);
      model.create(data, next);
    };
    async.waterfall([getDataCount, createData], callback);
  };

  const initOrderData = (model, data, callback) => {
    let index = 0;
    let isExist = true;
    const getDataCount = (next) => {
      model.count((error, count) => {
        isExist = count != 0;
        next(error);
      });
    };
    const createData = (next) => {
      if (isExist) return next(null);
      model.create(data[index], error => next(error));
      index += 1;
    };
    const taskList = [getDataCount];
    _.forEach(data, () => taskList.push(createData));
    async.waterfall(taskList, callback);
  };

  async.parallel({
    initUserList: async.apply(initTableData, userModel, userList),
    initRoleList: async.apply(initOrderData, roleModel, roleList),
    initUserRoleMappingList: async.apply(initTableData, userRoleMappingModel, userRoleMappingList),
    initDepartmentList: async.apply(initTableData, departmentModel, departmentList),
    initDictionaryList: async.apply(initTableData, dictionaryModel, dictionaryList),
    initFormList: async.apply(initOrderData, formModel, formList),
    initFlowList: async.apply(initOrderData, flowModel, flowList),
    initTemplateList: async.apply(initOrderData, templateModel, templateList),
  }, (error) => {
    if (error) console.log(error);
    else console.log('init db success');
  });
};
